﻿@page "{statusCode}"
@inherits Acesoft.Web.UI.RazorPages.WebPageBase
@using Microsoft.AspNetCore.Diagnostics
@{
    ViewData["Title"] = "Error." + Ace.Context.Response.StatusCode;

    var requestId = Activity.Current?.Id ?? Ace.Context.TraceIdentifier;
    var exFeature = Ace.Context.Features.Get<IExceptionHandlerPathFeature>();
    var scFeature = Ace.Context.Features.Get<IStatusCodeReExecuteFeature>();
}
<div class="container">
    <div class="pt30">
        <h1 class="text-danger">Error. @Ace.Context.Response.StatusCode</h1>
    </div>
    @if (requestId.HasValue())
    {
        <p class="pt20">
            <strong>Request ID:</strong> <code>@requestId</code>
        </p>
    }
    @if (exFeature != null)
    {
        <p><h2 class="text-danger">Exception: @exFeature.Error.GetMessage()</h2></p>
        <p><strong>RequestPath:</strong> <code>@exFeature.Path</code></p>
        <p><strong>StackTrace:</strong></p>
        <p><code>@exFeature.Error.StackTrace</code></p>
    }
    else if (scFeature != null)
    {
        <p><strong>RequestPath:</strong> <code>@scFeature.OriginalPath</code></p>
    }
</div>